home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / rl / build-bin / fls < prev    next >
Encoding:
Text File  |  2000-10-27  |  1.4 KB  |  66 lines

  1. #!/bin/sh
  2. # fls - file list
  3. # copyright (c) 2000, joseph cheek, joseph@redmondlinux.org
  4. # released under gpl.
  5. # $1: [partial] file to list.  can be with or without pathname.
  6. # ex: fls /opt/redmondLinux/builds/21/myfile
  7. # ex: fls col/install/myfile
  8. # ex: fls myfile
  9. # opts: -q: quiet [don't print status messages]
  10.  
  11.  
  12. if [ "n$1" = "n-q" ]; then # -q
  13.   QUIET="-q"
  14.   shift
  15. fi
  16.  
  17. if [ "$#" -ne 1 ]; then # wrong number of args
  18. ( echo `basename $0`: wrong number of arguments given
  19.   echo
  20.   echo usage: `basename $0` \[-q\] package
  21.   echo lists package in redmond linux build system
  22.   echo -q is quiet, ie don\'t print status messages ) >&2
  23.   exit 1
  24. fi
  25.  
  26.  
  27. # constants and vars
  28.  
  29. RL_ROOT=/opt/redmondlinux
  30. BUILD_NUM_FILE=$RL_ROOT/builds/CURRENT_BUILD
  31. BUILD_NUM=`cat $BUILD_NUM_FILE`
  32.  
  33. BUILD_ROOT=$RL_ROOT/builds/$BUILD_NUM
  34. BUILD_ROOT_LEN=$[ `echo $BUILD_ROOT | wc -c` - 0 ]
  35. # gives len of build_root plus 1
  36. CHANGELOG=$BUILD_ROOT/CHANGELOG
  37.  
  38. unset PATH_NAME
  39.  
  40. FILE_GLOB="$1"
  41.  
  42. # check for the file
  43.  
  44. # PATH_HEADER=`echo $PATH_NAME | cut -b 1-$BUILD_ROOT_LEN`
  45.  
  46. # if [ "$PATH_HEADER" != "$BUILD_ROOT/" ]; then # not in build root
  47. # ( echo `basename $0`: $1 not in build root
  48. #   echo
  49. #   echo usage: `basename $0` \[-q\] file
  50. #   echo removes file in redmond linux build system
  51. #   echo -q is quiet, ie don\'t print status messages ) >&2
  52. #   exit 1
  53. # fi
  54.  
  55.  
  56. # perform ls
  57.  
  58. find ${BUILD_ROOT} -name \*${FILE_GLOB}\*
  59. exit 0
  60.